package com.usefullc.system.dao;

import com.usefullc.system.domain.DataConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: Sampson
 * @date: 2022-01-09 09:56
 */
public interface DataConfigDao  extends JpaRepository<DataConfig, Long> {


    @Transactional
    @Modifying
    @Query(value = "update `sys_data_config` t set t.value = ?2,t.gmtModified=now(6) where t.code = ?1",nativeQuery = true)
    int updateValueByCode(String code,String value);

}
